import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    name: 'Home',
    redirect:'/login',
    component: ()=>import('@/views/admin/Home'),
    children:[
      // 首页
      {path:'/dashboard',component:()=>import('@/views/admin/Home/Home')},
      // 表格
      {path:'/table',component:()=>import('@/views/admin/Table')},
      // 用户列表
      {path:'/user',component:()=>import('@/views/admin/Username')},
      // 订单列表
      {path:'/order',component:()=>import('@/views/admin/Order')},
      // 订单列表
      {path:'/details',component:()=>import('@/views/admin/Details')},
      // 选项卡
      {path:'/tabs',component:()=>import('@/views/admin/Tab')},
      // 商品分类
      {path:'/goods',component:()=>import('@/views/admin/goods/goods')},
      // 商品二级分类
      {path:'/goodsSon/:id',component:()=>import('@/views/admin/goods/son')},
      // 商品列表
      {path:'/goodslist',component:()=>import('@/views/admin/goods/goodslist')},
      // 商品详情
      {path:'/goodsDetails',component:()=>import('@/views/admin/goods/details')},
      // 商品添加
      {path:'/goodsAdd',component:()=>import('@/views/admin/goods/addGoods')},
      // 商品添加
      {path:'/goodsEdit/:id',component:()=>import('@/views/admin/goods/edit')},
      // 表单
      {path:'/form',component:()=>import('@/views/admin/Form/Form')},
      // 编辑器
      {path:'/editor',component:()=>import('@/views/admin/Form/EditList/Editor')},
      // 编辑器
      {path:'/markdown',component:()=>import('@/views/admin/Form/EditList/Markdown')},
      // 文件
      {path:'/upload',component:()=>import('@/views/admin/Form/File')},
      // 自定义图标
      {path:'/icon',component:()=>import('@/views/admin/Icon')},
      // 图表
      {path:'/charts',component:()=>import('@/views/admin/Echarts')},
      // 拖拽列表
      {path:'/drag',component:()=>import('@/views/admin/move/List')},
      // 拖拽弹框
      {path:'/dialog',component:()=>import('@/views/admin/move/Alert')},
      // 国际化
      {path:'/i18n',component:()=>import('@/views/admin/Int')},
      // 404
      {path:'/404',component:()=>import('@/views/admin/Error/404')},
      // 403
      {path:'/permission',component:()=>import('@/views/admin/Error/Rights')},
      // 作者
      // {path:'/donate',component:()=>import('@/views/admin/Author')},
    ]
  },
  {path:'/login',component:()=>import('@/views/admin/Login')},
  {path: '*',redirect: '/404'}
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
